Module modules.constants

File name: constants.py Author: Martin Jůda Python Version: 3.7 Description: Module with constants

Expand source code
"""
    File name: constants.py
    Author: Martin Jůda
    Python Version: 3.7
    Description: Module with constants
"""

from enum import Enum

from modules.config import (
    BACKEND_BASE_URL,
    BACKEND_USER_PASSWORD,
    BACKEND_USER_NAME,
)

# Default GUI size without fullscreen
DISPLAY_DIMENSIONS = "1024x600"
# Question backend endpoint URL
QUESTIONS_URL = BACKEND_BASE_URL + "/questions"
# Picture backend endpoint URL
PICTURE_URL = BACKEND_BASE_URL + "/images/{picture_id}"
# Backend basic authorization
BACKEND_AUTH = (BACKEND_USER_NAME, BACKEND_USER_PASSWORD)


class Errors(Enum):
    """Error codes"""

    NO_ACTIVE_STUDY_ERROR = "NO_ACTIVE_STUDY"
    BACKEND_CONNECTION_ERROR = "CONNECTION_ERROR"
    HTTP_REQUEST_ERROR = "HTTP_ERROR"
    NO_QUESTIONS_ERROR = "NO_DOWNLOADED_QUESTIONS"
    IMAGE_LOAD_ERROR = "IMAGE_LOAD_ERROR"
    NO_ACCESS_ERROR = "USER_NO_ACCESS"

Classes

class Errors (value, names=None, *, module=None, qualname=None, type=None, start=1)

Error codes

Expand source code
class Errors(Enum):
    """Error codes"""

    NO_ACTIVE_STUDY_ERROR = "NO_ACTIVE_STUDY"
    BACKEND_CONNECTION_ERROR = "CONNECTION_ERROR"
    HTTP_REQUEST_ERROR = "HTTP_ERROR"
    NO_QUESTIONS_ERROR = "NO_DOWNLOADED_QUESTIONS"
    IMAGE_LOAD_ERROR = "IMAGE_LOAD_ERROR"
    NO_ACCESS_ERROR = "USER_NO_ACCESS"

Ancestors

  • enum.Enum

Class variables

var BACKEND_CONNECTION_ERROR
var HTTP_REQUEST_ERROR
var IMAGE_LOAD_ERROR
var NO_ACCESS_ERROR
var NO_ACTIVE_STUDY_ERROR
var NO_QUESTIONS_ERROR